<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <link rel="icon" href="./favicon.ico">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vite App</title>
  <!-- 超强缓存控制和安全设置 -->
  <!-- HTTP 1.1 缓存控制 -->
  <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate, proxy-revalidate, max-age=0, s-maxage=0">
  <!-- HTTP 1.0 缓存控制 -->
  <meta http-equiv="Pragma" content="no-cache">
  <!-- 过期时间设置 -->
  <meta http-equiv="Expires" content="-1">
  <!-- 禁止浏览器缓存 -->
  <meta http-equiv="Last-Modified" content="0">
  <!-- IE兼容性设置 -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <!-- 防止MIME类型嗅探 -->
  <meta http-equiv="X-Content-Type-Options" content="nosniff">
  <!-- 禁止预加载和预获取 -->
  <meta http-equiv="X-DNS-Prefetch-Control" content="off">
  <!-- 防止点击劫持 -->
  <!-- <meta http-equiv="X-Frame-Options" content="deny"> -->
  <!-- XSS保护 -->
  <!-- <meta http-equiv="X-XSS-Protection" content="1; mode=block"> -->
  <!-- 添加更强的缓存控制 -->
  <meta name="Cache-Control" content="no-cache">
  <meta name="Pragma" content="no-cache">
  <meta name="Expires" content="0">
  <meta name="cache-control" content="max-age=0">
  <meta name="cache-control" content="no-cache">
  <meta name="expires" content="0">
  <meta name="expires" content="Tue, 01 Jan 1980 1:00:00 GMT">
  <meta name="pragma" content="no-cache">
  
  <!-- Iconify 彩色图标库 - 轻量级且稳定 -->
  <script src="https://code.iconify.design/iconify-icon/1.0.7/iconify-icon.min.js"></script>
  
  <!-- 动态时间戳参数防止缓存 -->
  <script>
    // 在页面加载时清理本地缓存 - 增强版
    (function() {
      console.log('开始清理页面缓存...', Date.now());
      
      // 1. 清理localStorage
      if (window.localStorage) {
        const keysToRemove = [];
        for (let i = 0; i < localStorage.length; i++) {
          const key = localStorage.key(i);
          if (key && (key.includes('toolsWeb3') || 
                     key.includes('wpsjs') || 
                     key.includes('vue') ||
                     key.includes('vite') ||
                     key.includes('HelloWps') ||
                     key.includes('router') ||
                     key.includes('cache'))) {
            keysToRemove.push(key);
          }
        }
        keysToRemove.forEach(key => {
          localStorage.removeItem(key);
          console.log('清除localStorage缓存:', key);
        });
      }
      
      // 2. 清理sessionStorage
      if (window.sessionStorage) {
        const sessionKeysToRemove = [];
        for (let i = 0; i < sessionStorage.length; i++) {
          const key = sessionStorage.key(i);
          if (key && (key.includes('toolsWeb3') || 
                     key.includes('wpsjs') || 
                     key.includes('vue') ||
                     key.includes('vite') ||
                     key.includes('HelloWps') ||
                     key.includes('router') ||
                     key.includes('cache'))) {
            sessionKeysToRemove.push(key);
          }
        }
        sessionKeysToRemove.forEach(key => {
          sessionStorage.removeItem(key);
          console.log('清除sessionStorage缓存:', key);
        });
      }
      
      // 3. 清理可能的全局缓存对象
      ['__VUE_PROD_DEVTOOLS__', '__VUE_OPTIONS_API__', '__VUE_PROD_HYDRATION_MISMATCH_DETAILS__', '__PRELOADED_STATE__'].forEach(key => {
        if (window[key] !== undefined) {
          window[key] = undefined;
        }
      });
      
      console.log('本地缓存清理完成');
    })();
    
    // 4. 为所有外部资源添加超强时间戳参数
    window.addEventListener('DOMContentLoaded', function() {
      const timestamp = Date.now();
      const randomParam = Math.random().toString(36).substr(2, 9);
      const microTime = performance.now().toString().replace('.', '');
      const cacheBreaker = `t=${timestamp}&r=${randomParam}&mt=${microTime}`;
      
      // 为所有script和link标签添加时间戳
      document.querySelectorAll('script[src], link[href]').forEach(function(element) {
        const url = element.src || element.href;
        if (url && !url.includes('?')) {
          const separator = url.includes('?') ? '&' : '?';
          if (element.tagName === 'SCRIPT') {
            element.src = url + separator + cacheBreaker;
            console.log('为Script添加缓存破坏参数:', element.src);
          } else {
            element.href = url + separator + cacheBreaker;
            console.log('为Link添加缓存破坏参数:', element.href);
          }
        }
      });
      
      console.log('资源缓存破坏参数添加完成');
    });
    
    // 5. 页面卸载时清理缓存
    window.addEventListener('beforeunload', function() {
      console.log('页面卸载，清理缓存...');
      if ('caches' in window) {
        caches.keys().then(function(names) {
          names.forEach(function(name) {
            if (name.includes('toolsWeb3') || name.includes('wpsjs') || name.includes('vue')) {
              caches.delete(name);
            }
          });
        });
      }
    });
  </script>
  <script type="module" crossorigin src="./assets/index-DpXtOzER-mf81oxeg.js"></script>
  <link rel="modulepreload" crossorigin href="./assets/vue-23eUNVle-mf81oxeh.js">
  <link rel="modulepreload" crossorigin href="./assets/vue-router-CUSMWd76-mf81oxgp.js">
  <link rel="stylesheet" crossorigin href="./assets/index-CUFztf1Q-mf81oxn4.css">
</head>

<body>
  <div id="app"></div>
</body>

</html>